package message;

abstract public class Message implements java.io.Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public static final int OpenServiceId  			= 10;
	public static final int CloseServiceId 			= 20;
	public static final int CloseUserId 			= 21;
	public static final int ChooseFolderId			= 30;
	public static final int CreateFolderId 			= 40;
	public static final int DeleteFolderId 			= 50;
	public static final int GetFileId 				= 60;
	public static final int GetFileFullInFolderId	= 70;
	public static final int GetFileInFolderId		= 80;
	public static final int PutFileId				= 90;
	
	protected static final String sOpenServiceName			= "OpenService";
	protected static final String sCloseServiceName			= "CloseService";
	protected static final String sCloseUserName			= "CloseUser";
	protected static final String sChooseFolderName			= "ChooseFolder";
	protected static final String sCreateFolderName			= "CreateFolder";
	protected static final String sDeleteFolderName			= "DeleteFolder";
	protected static final String sGetFileName 				= "GetFile";
	protected static final String sGetFileFullInFolderName	= "GetFileFullInFolder";
	protected static final String sGetFileInFolderName		= "GetFileInFolder";
	protected static final String sPutFileName				= "PutFile";
	
	int 	m_iMessageId = 0;
	String 	m_sMessageName = "";
	
	// Status du resultat de l'execution
	boolean	m_bResultatExecution = false;
	String 	m_sResultatExecution = "";
	
	// Permet d'enregistrer le repertoire courant du serveur
	String m_sCurrentFolder = "";
	
	// Permet de stocker le nom de l'utilisateur
	String m_sUserName;
	
	public String getCurrentFolder() {
		return m_sCurrentFolder;
	}
	
	public void setCurrentFolder(String sCurrentFolder){
		m_sCurrentFolder = sCurrentFolder;
	}
	
	
	public String getM_sResultatExecution() {
		return m_sResultatExecution;
	}

	public void setM_sResultatExecution(String mSResultatExecution) {
		m_sResultatExecution = mSResultatExecution;
	}

	public boolean isM_bResultatExecution() {
		return m_bResultatExecution;
	}

	public void setM_bResultatExecution(boolean mBResultatExecution) {
		m_bResultatExecution = mBResultatExecution;
	}

	
	
	abstract boolean execute();

	public int getMessageId()
	{
		return m_iMessageId;
	}
	
	public String 	getMessageName()
	{
		return m_sMessageName;
	}
	
	void setMessageId( int iMessageId )
	{
		m_iMessageId = iMessageId;
	}
	
	void 	setMessageName( String sMessageName )
	{
		m_sMessageName = sMessageName;
	}
	
	public String getM_sUserName() {
		return m_sUserName;
	}

	public void setM_sUserName(String mSUserName) {
		m_sUserName = mSUserName;
	}
}
